<html lang="pt" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sec="http://www.springframework.org/security/facelets/tags"
	xmlns:p="http://primefaces.org/ui">
<h:form id="formCad">
	<div align="center">
		<h:panelGrid columns="1">
			<div class="user" align="center">

				<p:panel toggleable="false" header="Dados do Estabelecimento">
					<p:panelGrid columns="2">
						<p:panelGrid columns="2">
							<h:outputLabel value="Nome:" />
							<p:inputText value="#{clienteMB.entity.nome}"
								requiredMessage="Campo nome obrigatorio" required="true"
								validatorMessage="Campo Nome: Tamanho Minimo de 3 e Máximo de 50">
								<f:validateLength minimum="3" maximum="50" />
							</p:inputText>
						</p:panelGrid>

						<p:panelGrid columns="2">
							<h:outputLabel value="CPF:" />
							<p:inputMask value="#{clienteMB.entity.cpf}"
								requiredMessage="Campo CPF obrigatório" required="true"
								mask="999.999.999-99" title="Este campo não pode ser alterado" />
						</p:panelGrid>

						<p:panelGrid columns="2">
							<h:outputLabel value="Email:" />
							<p:inputText value="#{clienteMB.entity.email}" required="true"
								requiredMessage="Email:Campo obrigatório">
							</p:inputText>
						</p:panelGrid>
					</p:panelGrid>
				</p:panel>
s				<p:panel toggleable="false" header="Dados de Endereço"
					styleClass="semBorda">
					<p:panelGrid columns="2">
						<p:panelGrid columns="2">
							<h:outputLabel value="Rua/Avenida:" />
							<p:inputText value="#{clienteMB.enderecoCliente.rua}"
								requiredMessage="Campo RUA obrigatorio" required="true">
							</p:inputText>
						</p:panelGrid>

						<p:panelGrid columns="2">
							<h:outputLabel value="Número:" />
							<p:inputText value="#{clienteMB.enderecoCliente.numero}"
								requiredMessage="Campo NÚMERO obrigatório" required="true">
							</p:inputText>
						</p:panelGrid>
						
						<p:panelGrid columns="2">
							<h:outputLabel value="Bairro: " />
							<p:inputText value="#{clienteMB.enderecoCliente.bairro}"
								requiredMessage="Campo BAIRRO obrigatório" required="true">
							</p:inputText>
						</p:panelGrid>

						<p:panelGrid columns="2">
							<h:outputLabel value="Cidade:" />
							<p:inputText value="#{clienteMB.enderecoCliente.cidade}"
								requiredMessage="Campo CIDADE obrigatório" required="true">
							</p:inputText>
						</p:panelGrid>
						
						<p:panelGrid columns="2">
							<h:outputLabel value="Estado:" />
							<p:selectOneMenu value="#{clienteMB.estado}">
								<f:selectItem itemLabel="DF" itemValue="DF" />							
							</p:selectOneMenu>
						</p:panelGrid>
						
						<p:panelGrid columns="2">
							<h:outputLabel value="UF:" />
							<p:inputText value="#{clienteMB.enderecoCliente.uf}"
								requiredMessage="Campo UF obrigatório" required="true">
							</p:inputText>
						</p:panelGrid>

						<p:panelGrid columns="2">
							<h:outputLabel value="CEP:" />
							<p:inputText value="#{clienteMB.enderecoCliente.cep}"
								requiredMessage="Campo CEP obrigatorio" required="true">
							</p:inputText>
						</p:panelGrid>

						<p:panelGrid columns="2">
							<h:outputLabel value="Telefone:" />
							<p:inputText value="#{clienteMB.enderecoCliente.telefone1}"
								requiredMessage="Campo TELEFONE obrigatorio" required="true">
							</p:inputText>
						</p:panelGrid>


						<p:panelGrid columns="2">
							<h:outputLabel value="Celular:" />
							<p:inputText value="#{clienteMB.enderecoCliente.telefone2}"
								requiredMessage="Campo CELULAR obrigatorio" required="true">
							</p:inputText>
						</p:panelGrid>
					</p:panelGrid>
				</p:panel>


				<p:panel toggleable="false" header="Dados de Acesso"
					styleClass="semBorda">
					<div align="center">
						<p:panelGrid columns="2">
							<h:outputLabel value="Login :" />
								<p:inputText value="#{clienteMB.usuario.login}" />
								<h:outputLabel value="Senha :" />
								<p:password value="#{clienteMB.usuario.senha}" />

							</p:panelGrid>
					</div>
				</p:panel>
			</div>
			<div align="center">
				<p:panelGrid columns="2">
					<p:commandButton value="Salvar" action="#{clienteMB.save}"
						ajax="false" />
					<p:commandButton value="Cancelar"
						rendered="#{clienteMB.entity.id!=0}"
						action="#{clienteMB.cancelar}" ajax="false" />
				</p:panelGrid>
			</div>
		</h:panelGrid>
	</div>
</h:form>
</html>